Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NEWBIE HELP ME PLZ!!!!!!

Status
Not open for further replies.

JANET1979

Vendor
Dec 3, 2002
13
GB
Hello ppl,

i have just been introduced to assembly language and im affraid, very affraid!!!

this is one of the practice questions i have been looking at... has anyone got any ideas where i should start or what the layout should look like???

.. and what exactly is a positive going pulse !?!?!? :0

--------------------------------------------------------

an 8 bit unsigned integer will be input at port b, this is the target number that the player will try guess.

a positive going pulse at port A bit 4 will be used to indicate that the target number at port b is ready to be read.

once the data is entered the player can start guessing

the player will setup his guess at port b, and a positive going pulse port A bit 4 will be used to indicate to the program that a new guess is available
and should be read

If the guess is less than the target the program will set bit 0 of port A.

if its greater then it will set bit 1 of port A

if it is equal bothe bit 1 and bot 0 are set on port A

once correctly guessed the game should restart and accept a new target

second part...

modify version 1 of the game so that when the game is started, after the target number is entered, a second number (called n, in the range 1 to 8)
is entered in the same way as the target and stored.

after every guess, the target is rotated left by one bit position. the game then continues as before, but uses the new target

any help would be greatly appreciated
 
Janet,

I reckon the "positive going pulse" just means a binary '1' in this context, i.e. bit 4 of port A is '0' when it is not ready, but rises to '1' when it 'guess' is given:
Code:
                /------1 (ready)
               / 
(busy) 0------/  <- rising edge.
What needs to be done is a check to see if bit 4 is set, ie. there is a guess, something like:
Code:
wait:
  in al,A
  and al,00010000b
  jz wait
I think thats what you wanted. If you need more help post again. What you should do is try to write the program as best as you can. Pseudocode can often be helpful...
:)

Don't hate the player - hate the game
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top