我目前正在尝试完成我的任务,但我遇到了一些问题。
这是作业
https://i.imgur.com/UfilSVp.png
就像现在一样,当我输入“CC”时,我只会回来
Feed me(2 hex digits with the bits prsseeee):CC
Fall Semester
Total Fees = $ 97
我应该什么时候回来
Feed me(2 hex digits with the bits prsseeee): CC
Fall Semester
12 units
CA Resident
Parking
Total Fees = $ 688
这是我到目前为止所做的。
我也只能使用
** http://homepage.smc.edu/stahl_howard/cs17/FileManager/referenceguides/referenceguideiv.htm
至今
program SMCFee;
#include( "stdlib.hhf" );
static
total : int32 := 0;
begin SMCFee;
stdout.put("Feed me(2 hex digits with the bits prsseeee):" );
stdin.get(BL);
ror(4, BL);
and(%0000011, BL);
cmp(BL, %00);
je Fall;
cmp(BL, %01);
je Winter;
cmp(BL, %10);
je Spring;
cmp(BL, %11);
je Summer;
Fall:
stdout.put("Fall Semester",nl);
add(50, total);
ror(1, BL);
and(%0000001, BL);
cmp(BL, 0);
je NoFallResident;
cmp(BL, 1);
je FallResident;
FallResident:
rol(6, BL);
and(%00001111, BL);
mov(BL, AL);
stdout.put(AL,nl);
stdout.put("CA Resident");
FallUnitCheck:
cmp(AL, 0);
jle FallParkingCheck;
add(46, total);
dec(AL);
jmp FallUnitCheck;
FallParkingCheck:
ror(7, BL);
and(%0000001, BL);
cmp(BL, 0);
je NoFallResidentParking;
cmp(BL, 1);
je FallResidentParking;
FallResidentParking:
stdout.put("Parking",nl);
add(85, total);
jmp zend;
NoFallResidentParking:
jmp zend;
NoFallResident:
ror(1, BL);
and(%0000001, BL);
cmp(BL, 0);
je FallNoResidentParking;
cmp(BL, 1);
je NoFallNoResidentParking;
FallNoResidentParking:
NoFallNoResidentParking:
Winter:
add(47, total);
jmp zend;
Spring:
add(47, total);
jmp zend;
Summer:
add(50, total);
jmp zend;
zend:
stdout.put("Total Fees = $ ",total);
end SMCFee;