Message Box and Dialogs
Yes, SL45 also has some (many) display message box, such as : 0xE6F138, 0xE6EF0A, 0xE6F198, 0xE6EFE4, 0xD4E960, etc-etc. There are also some show Dialog routines, 0xE5DD76, 0xE5DE28, 0xE5ECD8, etc-etc.
Mostly, I use the one in 0xE5DDCE (why? because, in my current knowledge, this is the most compact ones) ... and here is my 'generic' syntax :
Code:
#define showMsgIcon2 0E5DDCEh
x_main:
mov r12, #q(x_data)
mov r13, #p(x_data)
mov r14, #q(x_text)
mov r15, r13 ; save 2 bytes
jmps showMsgIcon2
x_handler:
mov r4, r14
cmp r14, #23h ; if yes pressed
jmpr cc_NZ, xh_rets
jmps yes_function ; the function for Yes button
xh_rets:
rets
x_data:
dw 0,0,2
x_text:
dw 4a0h, 0b5h, 7fffh ; pointer to text to displayed
dw 0,0
dw o(x_handler), s(x_handler)
dw 0,0,2c5ah,2e2h,4e26h,2 ; pointer to yes+no button definition
Actually x_text is separated from x_data, but I like to save some spaces, so I combine both, and x_text is become a part of x_data. The original format is :
x_text:
dw string_ID, string_ID, string_ID, ... ,7fffh
x_data:
dw 0,0,2,x,y,7fffh, ... 2e2h,4e26h,2
I dunno the meaning of each word in the x_data, but some of them (time-to-wait, handler, and button-definition). I use a 'generic' format to display the generic (but different text) dialog.
I saw that SME45iv04 has more 'powerfull' built-in displayYesNoDialog, such as : 0xFA4E18 (r12=style?,r13=text,r14=ofs(yes_handler),r15=seg( yes_handler)) ...
rizapn