Hello everyone,
there is a new HJWasm release on the
Terraspace with some sophisticated improvements 8)
Built in two new options for the .SWITCH block:
option SWITCHSTYLE : ASMSTYLE (default)
option SWITCHSTYLE: CSTYLE (optional)
hutch, I hope you will be happy with this one, now you have ASMSTYLE .SWITCH block, thank you for your suggestion :t
Multiple cases can be used with the comma ',' and can be continued in new line if they don't fit in one
If you don't need .DEFAULT it can be omitted in both ASMSTYLE or CSTYLE
This version also reduces memory consumption in multiple cases, it will create only one jump table for all cases in both styles.
You can switch to another style and go back to first one as many time as you want using
option SWITCHSTYLEhere are some examples:
mov eax, 184h
.switch eax
.case 179h,180h,1c5h,17bh,17dh,
182h,184h,185h
mov edx,1d5h
.case 1d3h
mov edx, 1d3h
.case 1f4h
mov edx, 1f4h
.case 200h
mov edx, 200h
.case 201h
mov edx, 201h
.case 202h
mov edx, 202h
.case 203h
mov edx, 203h
.default
mov edx, 0
.endswitch
option SWITCHSTYLE: CSTYLE
mov eax, 184h
.switch eax
.case 179h, 180h, 1c5h, 17bh, 17dh,
182h, 184h, 185h
mov edx, 1d5h
.break
.case 1d3h
mov edx, 1d3h
.break
.case 1f4h
mov edx, 1f4h
.break
.case 200h
mov edx, 200h
.break
.case 201h
mov edx, 201h
.break
.case 202h
mov edx, 202h
.break
.case 203h
mov edx, 203h
.break
.default
mov edx, 0
.break
.endswitch
option SWITCHSTYLE : ASMSTYLE
.switch bl
.case 202
mov edx, 202
.case 203
mov edx, 203
.case 2013
mov edx, 213
.endswitch