Created
May 22, 2014 17:16
-
-
Save ramntry/ca85de17e42129305d3e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
model tiny | |
.code | |
org 100h | |
_: jmp start | |
m1 db 'Hello, INT!',13,10,'$' | |
f0 db '(func 0)',13,10,'$' | |
f1 db '(func 1)',13,10,'$' | |
fer db '(error)',13,10,'$' | |
v_f1 dd 0 | |
f_f1 dw f1_0 | |
dw f1_1 | |
dw f1_err | |
i_f1: xor bx,bx | |
mov bl,ah | |
and bl,1 | |
test ah,0FEh | |
jz _0 | |
mov bl,2 | |
_0: shl bx,1 | |
jmp f_f1[bx] | |
f1_0: mov dx,offset m1 | |
mov ah,9 | |
int 21h | |
mov dx,offset f0 | |
mov ah,9 | |
int 21h | |
iret | |
f1_1: mov dx,offset m1 | |
mov ah,9 | |
int 21h | |
mov dx,offset f1 | |
mov ah,9 | |
int 21h | |
iret | |
f1_err: mov dx,offset m1 | |
mov ah,9 | |
int 21h | |
mov dx,offset fer | |
mov ah,9 | |
int 21h | |
iret | |
start: mov ax,35F1h | |
int 21h | |
mov word ptr v_f1,bx | |
mov word ptr v_f1+2,es | |
mov dx,offset i_f1 | |
mov ax,25F1h | |
int 21h | |
xor ah,ah | |
int 0F1h | |
mov ah,1 | |
int 0F1h | |
mov ah,2 | |
int 0F1h | |
lds dx,v_f1 | |
mov ax,25F1h | |
int 21h | |
ret | |
end _ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment