Assembly Irvine 32 Macros

32 views Asked by At
include irvine32.inc

mReadstring macro buffer
LOCAL localBuffer
.data
    localBuffer byte buffer, 0
.code

    push edx
    push ecx
    lea edx, buffer
    mov ecx, lengthof buffer
    call readstring
    pop ecx
    pop edx

endm

mWrite macro strig:req
LOCAL stringMsg
.data
    stringMsg byte strig,0
.code

    push edx
    lea edx, stringMsg
    call writestring
    pop edx

endm 

mGotoxy macro x:req, y:req

    push edx
    mov dh, y
    mov dl, x
    call gotoxy
    pop edx

endm

mAskForString macro col:req, rows:req, promptMsg:req, number:req

    call clrscr
    mGotoxy col, rows
    mWrite promptMsg
    mReadstring number
    mWrite number

endm

.data

    accNumber byte 20 dup(0)
    prompt byte "Enter account number: ",0

.code
main proc

    mAskForString 4, 2, prompt, accNumber

    exit
main endp
end main

I am expecting the code to prompt for user account number and display on specified column and row but there is an error telling that initializer magnitude too large for specified size.

0

There are 0 answers