# Program 1 Write an HLA Assembly program that prompts for an int8 value to inspect and then prints it in binary format. For example, here would be the program output for various entered values Gimme a

Program 1

Write an HLA Assembly program that prompts for an int8 value to inspect and then prints it in binary format. For example, here would be the program output for various entered valuesGimme a decimal value to print: 1515 is 0000_1111Gimme a decimal value to print: 77 is 0000_0111(Hint: There is no standard output that prints in binary output, so you need to do this yourself. In order to accomplish this, you need to move a bit at time into the carry flag and print 0 or 1, depending on what you find in the Carry bit. Shift and repeat this procedure 8 times and you are done! Eventually, we will learn how to loop, which would make this task much less terrible.)

(Second Hint:LAHF pushes the Carry Bit and all the other flags out of the EFLAGS register and into AH. As an Assembly programmer, you have the power to mask out all the bits but the one you are interested in by using either AND or OR.)

### Save your time - order a paper!

Get your paper written from scratch within the tight deadline. Our service is a reliable solution to all your troubles. Place an order on any task and we will take care of it. You won’t have to worry about the quality and deadlines

Order Paper Now

Program 2

Using the ROL instruction to perform doubling, write a program to produce a quad table.  This table should be built from a single int32 value provided by the user and print three rows from the starting value, each offset by one from the starting value. In that column, the pattern of quad numbers should be calculated by doing ROL instructions twice on each value.  For example, the following output should be produced when the user inputs the starting value 4:Gimme a starting value: 4Quad Table4:  16 645:  20 806:  24 96

For example, the following output should be produced when the user inputs the starting value 7:

Gimme a starting value: 7Quad Table7:  28  1128:  32  1289:  36  144

(Note: To receive full credit, you must use ROL to solve this problem.)  (Hint: Again, please don’t worry too much about the spacing in the table.

It should be the case that the only instructions you need to complete the programs assigned here are the ones in the pdf file

Program 1 Write an HLA Assembly program that prompts for an int8 value to inspect and then prints it in binary format. For example, here would be the program output for various entered values Gimme a
Programmer’s Reference to HLA Assembly Language Typical Program Structure progID ; variable declarations progID ; statements progID ; Assembly Language Instructions Instruction Syntax Description MOV mov( source, dest ); dest = source; ADD add( source, dest ); dest += source; SUB sub( source, dest ); dest -= source; SHL shl( count, dest ); shuffles left a total of count bits in dest operand; sets carry when count=1 SHR shr( count, dest ); shuffles right a total of count bits in dest operand; sets carry when count=1 SAR sar( count, dest ); shuffles right a total of count bits in dest operand; sets carry when count=1; leaves H.O. bit unchanged ROL rol( count, dest ); rotates left a total of count bits Available Datatypes int8 int16 int32 boolean Available I/O Routines stdout.put stdout.puti8 stdout.puti16 stdout.puti32 stdout.putb stdout.putw stdout.putd stdout.newln stdin.get stdin.geti8 stdin.geti16 stdin.geti32 stdin.getb stdin.getw stdin.getd in dest operand; sets carry when count=1 ROR ror( count, dest ); rotates right a total of count bits in dest operand; sets carry when count=1 NOT not( ); inverts the bits of the dest operand AND and( source, dest ); bitwise logical AND; result placed in dest operand OR or( source, dest ); bitwise inclusive OR; result placed in dest operand XOR xor( source, dest ); bitwise exclusive OR; result placed in dest operand LAHF lahf( ); pushes the lower 8 bits of EFLAGS register into AH