Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
1.3 KiB

  1. .286P
  2. _TEXT SEGMENT WORD PUBLIC 'CODE'
  3. _TEXT ENDS
  4. _DATA SEGMENT WORD PUBLIC 'DATA'
  5. _DATA ENDS
  6. CONST SEGMENT WORD PUBLIC 'CONST'
  7. CONST ENDS
  8. _BSS SEGMENT WORD PUBLIC 'BSS'
  9. _BSS ENDS
  10. DGROUP GROUP _DATA, CONST, _BSS
  11. ASSUME CS:_TEXT, DS:DGROUP, ES:DGROUP, SS:DGROUP
  12. PUBLIC _p2w
  13. EXTRN _printf:NEAR
  14. include callconv.inc ; calling convention macros
  15. _DATA SEGMENT
  16. s1 db ' equ 0',0
  17. s2 db '%hX%04hXH',0ah,0
  18. s3 db '%hXH',0ah,0
  19. _DATA ends
  20. _TEXT segment
  21. ;
  22. ; p2w(&ULONG which is value to print)
  23. ;
  24. ; if ([bx+2] != 0)
  25. ; printf(bx+2, bx, %x, %04x)
  26. ; else
  27. ; printf(bx, %x)
  28. _p2w PROC NEAR
  29. ; Line 688
  30. push bp
  31. mov bp, sp
  32. push bx
  33. push di
  34. push si
  35. push offset DGROUP:s1
  36. call _printf
  37. add sp,2
  38. mov bx,[bp+4]
  39. cmp word ptr [bx+2],0
  40. jz p2w10
  41. push [bx]
  42. push [bx+2]
  43. push offset DGROUP:s2
  44. call _printf
  45. add sp,6
  46. jmp p2w20
  47. p2w10: push [bx]
  48. push offset DGROUP:s3
  49. call _printf
  50. add sp,4
  51. p2w20: pop si
  52. pop di
  53. pop bx
  54. leave
  55. stdRET _p2w
  56. _p2w ENDP
  57. _TEXT ENDS
  58. END