strhp.s 347 B

123456789101112131415161718192021222324252627
  1. .sect .text; .sect .rom; .sect .data; .sect .bss
  2. .sect .text
  3. .define .strhp
  4. .extern .reghp, .limhp, EHEAP, .trp
  5. .strhp:
  6. pop ebx
  7. pop eax
  8. mov (.reghp),eax
  9. cmp eax,(.limhp)
  10. jb 1f
  11. add eax,02000
  12. and eax,~0777
  13. push ebx
  14. push eax
  15. call BRK
  16. pop ecx
  17. pop ebx
  18. cmp eax,-1
  19. je 2f
  20. 1:
  21. mov (.limhp),ecx
  22. jmp ebx
  23. 2:
  24. mov eax,EHEAP
  25. push ebx
  26. jmp .trp