Question: I have a problem with my code. I keep getting these errors and I can't quite figure out what's going wrong. Error in file IncreasingCheck.hla
I have a problem with my code. I keep getting these errors and I can't quite figure out what's going wrong.
Error in file "IncreasingCheck.hla" at line errid:hlaparsebsn:
Identifier must match program name.
Near: main
Error in file "IncreasingCheck.hla" at line errid:hlaparsec:
syntax error, unexpected varTkn.
Near: var
Here's the full code:
program IncreasingCheck;
#includestdlibhhf
procedure increasingw: int; x: int; y: int; z: int; @nodisplay; @noframe;
begin increasing;
Preserve AX register
pushax;
Load parameters from the stack in reverse order z y x w
movebp al; z in AL
movebp bl; y in BL
movebp cl; x in CL
movebp dl; w in DL
Check if w x
cmpdl cl; DL holds w CL holds x
jnl notincreasing; If wx jump to notincreasing
Check if x y
cmpcl bl; CL holds x BL holds y
jnl notincreasing; If xy jump to notincreasing
Check if y z
cmpbl al; BL holds y AL holds z
jnl notincreasing; If y z jump to notincreasing
All conditions met, set AL to
mov al;
jmp done;
notincreasing:
Set AL to if any condition fails
mov al;
done:
Restore AX register
popax;
end increasing;
begin main;
Declare local variables
var
w: int;
x: int;
y: int;
z: int;
Code to get input values
stdout.putFeed Me W: ;
stdin.getw;
stdout.putFeed Me X: ;
stdin.getx;
stdout.putFeed Me Y: ;
stdin.gety;
stdout.putFeed Me Z: ;
stdin.getz;
Call the increasing function
pushz;
pushy;
pushx;
pushw;
call increasing;
add esp; Clean up stack parameters bytes each
Output result
ifal then
stdout.putIncreasing AL nl;
else
stdout.putNot Increasing. AL nl;
endif;
end main;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
