Function definition: Difference between revisions

Content added Content deleted
Line 137: Line 137:


<lang asm>start:
<lang asm>start:
mov ax, 0x0400
mov al, 0x04
mov bx, 0x0500
mov bl, 0x05
call sum
call domultiply
;at this point in execution, the AX register contains 0x0900.
;at this point in execution, the AX register contains 0x0900.
;more code goes here, ideally with some sort of guard against "fallthrough" into sum.
;more code goes here, ideally with some sort of guard against "fallthrough" into sum.
Line 145: Line 145:
; somewhere far away from start
; somewhere far away from start
sum:
sum:
mul bl ;outputs 0x0014 to ax
add ax,bx
ret</lang>
ret</lang>