2 ; Copyright (C) 2008 Alexander Potashev
4 ; Calculating of the number of zero words of 10 top words in the stack
22 ;-----------------------
26 ;-----------------------
27 mov bp, sp ; using "bp" to access stack variables
33 cmp word ptr [bp], 0 ; educational way
38 ; mov dx, [bp] ; --- another, "cheat" way (without "cmp") ---
39 ; sub dx, 1 ; CF=1 if dx=0
45 ;-----------------------
46 ; now "ax" contains the result (possible values: 0..10)
61 ;-----------------------
69 text
db "10", 13, 10, '$'