Free for PREMIUM members
Go Premium for a chance to win a PS4. Enter to Win
Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.
vector: .EQUATE 2 ;LOCAL VARIABLE
i: .EQUATE 2 ;LOCAL VARIABLE
main: SUBSP 10,i ;allocate 10 bytes for locals
LDX 0,i ;for(i = 0
for1: CPX 4,i ; i<4
ASLX ;each element is 2 bytes
DECI vector,sx ; cin >> vector[i]
endFor1: LDX 3,i ;for(i = 3
for2: CPX 0,i ; i>=0
DECO i,s ; cout << i
CHARO ' ',i ; << ' '
ASLX ;PEP uses 16bit ints (2bytes)
DECO vector,sx ; << vector[i]
CHARO '\n',i ; << endl
LDX i,s ; i--
endFor2: ADDSP 10,i ;deallocate 10 bytes
Open in new window
Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.