{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

g - Page 1 of 1 10 REM Program that reads/writes 2nd...

Info icon This preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
10 REM *** Program that reads/writes 2nd generation smart-cards *** 20 REM *** through a direct connection with the parallel port. *** 30 REM *** L. Padilla (e-mail: padilla at domain "gae ucm es") *** 40 REM *** Madrid, 1996, Ver 2.1 (1997) *** 50 OPTION BASE 1 : DIM BYTE%(64) 60 OUT 888, 0 : REM *** 0v data pins *** 70 PRINT "Insert card and hit F5 (CONT)." : STOP 80 REM *** Reset card: *** 90 OUT 888, 2^0 : REM *** +5v pins 2(Vcc) *** 100 OUT 888, 2^1 + 2^0 : REM *** +5v 2,3(Reset) *** 110 OUT 888, 2^2 + 2^1 + 2^0 : REM *** +5v 2,3,4(Clock) *** 120 OUT 888, 2^1 + 2^0 : REM *** +5v 2,3 *** 130 OUT 888, 2^0 : REM *** +5v 2 *** 140 REM *** Go through all the addresses: *** 150 PRINT "By b7 b6 b5 b4 b3 b2 b1 b0 Dec Hex A |Byt b7 b6 b5 b4 b3 b2 b1 b0 Dec Hex A" 160 PRINT "-- -- -- -- -- -- -- -- -- --- --- - |--- -- -- -- -- -- -- -- -- --- --- -" 170 FOR I% = 1 TO 64 180 BYTE%(I%) = 0 190 IF (I% MOD 2 = 0) THEN PRINT " "; 200 PRINT USING "## "; I%; 210 FOR J% = 7 TO 0 STEP -1 220 BITCOUNT% = I% * 8 - J% 230 NUM% = 1 : REM *** Choose write or writecarry *** 240 REM *** Write if required: *** 250 IF (BITCOUNT% >= 1000 AND BITCOUNT% <= 1000) THEN GOSUB 630 260 BIT% = INP (889) AND 8 : REM *** Read pin 15 (I/O) *** 270 BIT% = BIT%/8 : PRINT BIT%; 280 BYTE%(I%) = BYTE%(I%) + BIT% * 2^J% 290 GOSUB 710 300 NEXT J% 310 PRINT USING " ### "; BYTE%(I%); 320 IF (BYTE%(I%) < 16) THEN PRINT " "; 330 PRINT HEX$ (BYTE%(I%)); 340 PRINT " ";
Image of page 1
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern