これが私の質問です
Q) 関数のオフセットを取得し、このオフセットを最大 8 個のオフセットを保持できる配列に記憶する関数「addtoset」を作成します。セットにすでに 8 つのオフセットがある場合は何もしません。セット内のすべての関数を 1 つずつ呼び出す別の関数「callset」を記述します。
最初は 3 つの関数でそれを実行しようとしています。コードで確認できます (NASM 16 ビット アーキテクチャを使用しています)。
これが私のコードです。アセンブルしますが、出力が表示されません。どうすれば修正できますか?
org 100h
segment data
arr dw 0,0,0
count dw 0
section .text
mov bx , arr; assigning address of arr to bx
mov ax , fun1;moving offset of fun1 to ax
call addtoast
mov ax , fun2;moving offset of fun2 to ax
call addtoast
mov ax , fun3;moving offset of fun3 to ax
call addtoast
call callset
end:
MOV AH,4CH
INT 21H
callset:;this function will call other functions
call arr
call [arr+2]
call [arr+4]
ret
addtoast:;this function puts offset into array
mov [bx+count], ax
add [count], word 2
ret
fun1:;prints 1
mov dx , '1'
mov ah , 2h
int 21h
ret
fun2:;prints 2
mov dx , '2'
mov ah , 2h
int 21h
ret
fun3:;prints 3
mov dx , '3'
mov ah , 2h
int 21h
ret