All pastes #196453 Raw Edit

Unnamed

public text v1 · immutable
·published 2006-10-10 16:36 UTC
rendered paste body
Hi al this code works but in the getcurspos function below I added the line push ah after an interrupt in the hope to push the contents of the register on the stack however I get a 
zeonos.asm:90: error: invalid combination of opcode and operands

;----------------------------------------------------------------------
; Hello World Operating System
;
; Joel Gompert 2001
;
; Disclaimer: I am not responsible for any results of the use of the contents
;   of this file
;----------------------------------------------------------------------

; --------------------------------------------
;  Here is the operating system entry point
; --------------------------------------------
begin:  
        
	mov	ax, cs		; Get the current segment
	mov	ds, ax		; The data is in this segment
	cli			; disable interrupts while changing stack
	mov	ss, ax		; We'll use this segment for the stack too
	mov	sp, 0xfffe	; Start the stack at the top of the segment
	sti			; Reenable interrupts
        call    zap
        mov	si, msg	
	
	
        	; load address of our message
	
        call sortcursor
	call	putstr		; print the message
        call getcurspos
      

hang:
	jmp	hang		; just loop forever.

; --------------------------------------------
; data for our program


msg	db	'Zeon', 0
stx	db	'ReadyFI', 0

; ---------------------------------------------
; Print a null-terminated string on the screen
; ---------------------------------------------

zap:
;Gives you an on-screen button to click on with the mouse, and
;proceeds only when you do!
;mov ah,06h ;this calls SCROLL SCREEN UP
;mov al,00h ;AL specifies how many lines... 0 just clears the screen
;mov ch,00h
;mov cl,00h
;mov dh,85h			; cursor col 
;mov dl,85h ;from left to right clears
;mov ah,02h
;mov bh,1
;int 10h
mov ah,06
  mov al,00
  mov bh,07
  mov cx,00
  mov dx,184fh
  int 10h
retn

putstr:
	lodsb		; AL = [DS:SI]
	or al, al	; Set zero flag if al=0
	jz putstrd	; jump to putstrd if zero flag is set
	mov ah, 0x0e	; video function 0Eh (print char)
	mov bx, 0x0007	; color
        
	int 0x10
	jmp putstr
putstrd:
	retn

sortcursor:
  mov ah,02
  mov dl,30
  mov bh,00
  mov dx,00
  int 10h
retn

getcurspos:
mov ah,03h 
mov bh,00h
int 10h
push ah //error here

retn