flat assembler
Message board for the users of flat assembler.
Index
> Windows > [Solved]What's wrong with my code ? |
Author |
|
sleepsleep 12 Dec 2014, 19:13
if [handle]
maybe? |
|||
12 Dec 2014, 19:13 |
|
lacamoura 12 Dec 2014, 19:18
I get
Code: flat assembler version 1.71.22 (869198 kilobytes memory) HELLO.asm [11]: if [handle] = IDYES [b]error: invalid value.[/b] |
|||
12 Dec 2014, 19:18 |
|
sleepsleep 12 Dec 2014, 19:35
ah, so sorry, not much idea,
maybe is AH? i guess maybe you are correct with if handle = IDYES, |
|||
12 Dec 2014, 19:35 |
|
lacamoura 12 Dec 2014, 19:51
sleepsleep wrote:
I'm new to assemby, yes. but I know that AL is the least-significant byte, and the AH is the most-significant byte in AX and i tried with Code: .data handle dd ? and Code: mov [handle], eax still doesn't work |
|||
12 Dec 2014, 19:51 |
|
randomdude 12 Dec 2014, 20:22
i think 'if' checks it at compile time, try with '.if'
.if byte[handle] = IDYES invoke MessageBox, 0, "You are an adult Smile", "SimpleApp", MB_OK .endif |
|||
12 Dec 2014, 20:22 |
|
lacamoura 12 Dec 2014, 20:52
randomdude wrote: i think 'if' checks it at compile time, try with '.if' thanks randomdude, you're right about compile time but FASM gave a lot of errors when I tried .if .... .endif so tried low level comparaison, and it works Code: include 'win32ax.inc' .data handle db ? .code Start: invoke MessageBox, 0, "Are you over 18 ?", "SimpleApp", MB_YESNO mov [handle], al ;if handle = IDYES cmp [handle], IDYES jne .ExitApp invoke MessageBox, 0, "You are an adult ", "SimpleApp", MB_OK ;end if .ExitApp: invoke ExitProcess, 0 .end Start |
|||
12 Dec 2014, 20:52 |
|
tthsqe 12 Dec 2014, 22:39
see http://board.flatassembler.net/topic.php?t=7217 for lots of uses of .if .else ect
|
|||
12 Dec 2014, 22:39 |
|
lacamoura 14 Dec 2014, 17:14
@tthsqe thanks dude
|
|||
14 Dec 2014, 17:14 |
|
CampTheBoss 02 Feb 2015, 20:32
There is an easy way to do it. (it requires Win32ax)
Code: invoke MessageBox,0,yourmsg,yourcaption,MB_YESNO .if EAX = IDYES jmp good .endif invoke ExitProcess,0 good: invoke MessageBox,0,goodmsg,yourcaptopn,MB_OK invoke ExitProcess,0 |
|||
02 Feb 2015, 20:32 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.