Paste number 145641: sbcl disassembly

Paste number 145641: sbcl disassembly
Pasted by: adlai
When:4 years, 9 months ago
Share:Tweet this! | http://paste.lisp.org/+34DL
Channel:None
Paste contents:
Raw Source | XML | Display As
; disassembly for PARSE-PRICE
; Size: 421 bytes. Origin: #x10390547
; 547:       8D41F9           LEA EAX, [ECX-7]                ; no-arg-parsing entry point
; 54A:       A807             TEST AL, 7
; 54C:       0F8547010000     JNE L11
; 552:       8079F9E2         CMP BYTE PTR [ECX-7], 226
; 556:       0F853D010000     JNE L11
; 55C:       8BD9             MOV EBX, ECX
; 55E:       8B71FD           MOV ESI, [ECX-3]
; 561:       31C0             XOR EAX, EAX
; 563:       E91F010000       JMP L10
; 568: L0:   8B540301         MOV EDX, [EBX+EAX+1]
; 56C:       83FA2E           CMP EDX, 46
; 56F:       0F850F010000     JNE L9
; 575:       8BD8             MOV EBX, EAX
; 577: L1:   895DF0           MOV [EBP-16], EBX
; 57A:       8D7424F8         LEA ESI, [ESP-8]
; 57E:       83EC0C           SUB ESP, 12
; 581:       BA422E0000       MOV EDX, 11842
; 586:       8BF9             MOV EDI, ECX
; 588:       8B050C053910     MOV EAX, [#x1039050C]           ; #<FDEFINITION object for REMOVE>
; 58E:       B908000000       MOV ECX, 8
; 593:       892E             MOV [ESI], EBP
; 595:       8BEE             MOV EBP, ESI
; 597:       FF5005           CALL DWORD PTR [EAX+5]
; 59A:       8D7424F8         LEA ESI, [ESP-8]
; 59E:       83EC0C           SUB ESP, 12
; 5A1:       8B0510053910     MOV EAX, [#x10390510]           ; #<FDEFINITION object for PARSE-INTEGER>
; 5A7:       B904000000       MOV ECX, 4
; 5AC:       892E             MOV [ESI], EBP
; 5AE:       8BEE             MOV EBP, ESI
; 5B0:       FF5005           CALL DWORD PTR [EAX+5]
; 5B3:       8B5DF0           MOV EBX, [EBP-16]
; 5B6:       8BF2             MOV ESI, EDX
; 5B8:       8975F8           MOV [EBP-8], ESI
; 5BB:       8B75F8           MOV ESI, [EBP-8]
; 5BE:       29DF             SUB EDI, EBX
; 5C0:       2B7DFC           SUB EDI, [EBP-4]
; 5C3:       897DFC           MOV [EBP-4], EDI
; 5C6:       837DFC00         CMP DWORD PTR [EBP-4], 0
; 5CA:       751D             JNE L4
; 5CC:       8B55F8           MOV EDX, [EBP-8]
; 5CF:       8BF4             MOV ESI, ESP
; 5D1:       52               PUSH EDX
; 5D2:       B904000000       MOV ECX, 4
; 5D7: L2:   83F904           CMP ECX, 4
; 5DA:       7508             JNE L3
; 5DC:       8B56FC           MOV EDX, [ESI-4]
; 5DF:       8BE5             MOV ESP, EBP
; 5E1:       F8               CLC
; 5E2:       5D               POP EBP
; 5E3:       C3               RET
; 5E4: L3:   E927FAC6F0       JMP #x1000010                   ; RETURN-MULTIPLE
; 5E9: L4:   837DFC00         CMP DWORD PTR [EBP-4], 0
; 5ED:       7F3C             JNLE L6
; 5EF:       8B7DFC           MOV EDI, [EBP-4]
; 5F2:       F7DF             NEG EDI
; 5F4:       8D5C24F8         LEA EBX, [ESP-8]
; 5F8:       83EC0C           SUB ESP, 12
; 5FB:       BA28000000       MOV EDX, 40
; 600:       8B0514053910     MOV EAX, [#x10390514]           ; #<FDEFINITION object for EXPT>
; 606:       B908000000       MOV ECX, 8
; 60B:       892B             MOV [EBX], EBP
; 60D:       8BEB             MOV EBP, EBX
; 60F:       FF5005           CALL DWORD PTR [EAX+5]
; 612:       8B45F8           MOV EAX, [EBP-8]
; 615:       C1F802           SAR EAX, 2
; 618:       0FAFC2           IMUL EAX, EDX
; 61B: L5:   8BD0             MOV EDX, EAX
; 61D:       8B7DFC           MOV EDI, [EBP-4]
; 620:       8BF4             MOV ESI, ESP
; 622:       52               PUSH EDX
; 623:       57               PUSH EDI
; 624:       B908000000       MOV ECX, 8
; 629:       EBAC             JMP L2
; 62B: L6:   8975F4           MOV [EBP-12], ESI
; 62E:       8D5C24F8         LEA EBX, [ESP-8]
; 632:       83EC0C           SUB ESP, 12
; 635:       8B7DFC           MOV EDI, [EBP-4]
; 638:       BA28000000       MOV EDX, 40
; 63D:       8B0514053910     MOV EAX, [#x10390514]           ; #<FDEFINITION object for EXPT>
; 643:       B908000000       MOV ECX, 8
; 648:       892B             MOV [EBX], EBP
; 64A:       8BEB             MOV EBP, EBX
; 64C:       FF5005           CALL DWORD PTR [EAX+5]
; 64F:       8B75F4           MOV ESI, [EBP-12]
; 652:       8BFA             MOV EDI, EDX
; 654:       8D5C24F8         LEA EBX, [ESP-8]
; 658:       83EC0C           SUB ESP, 12
; 65B:       8BD6             MOV EDX, ESI
; 65D:       8B0518053910     MOV EAX, [#x10390518]           ; #<FDEFINITION object for TRUNCATE>
; 663:       B908000000       MOV ECX, 8
; 668:       892B             MOV [EBX], EBP
; 66A:       8BEB             MOV EBP, EBX
; 66C:       FF5005           CALL DWORD PTR [EAX+5]
; 66F:       85FF             TEST EDI, EDI
; 671:       7504             JNE L8
; 673: L7:   8BC2             MOV EAX, EDX
; 675:       EBA4             JMP L5
; 677: L8:   837DF800         CMP DWORD PTR [EBP-8], 0
; 67B:       7DF6             JNL L7
; 67D:       83EA04           SUB EDX, 4
; 680:       8BC2             MOV EAX, EDX
; 682:       EB97             JMP L5
; 684: L9:   83C004           ADD EAX, 4
; 687: L10:  39F0             CMP EAX, ESI
; 689:       0F8CD9FEFFFF     JL L0
; 68F:       BB0B001001       MOV EBX, 17825803
; 694:       E9DEFEFFFF       JMP L1
; 699: L11:  8D41F9           LEA EAX, [ECX-7]
; 69C:       A807             TEST AL, 7
; 69E:       7506             JNE L12
; 6A0:       8079F9DE         CMP BYTE PTR [ECX-7], 222
; 6A4:       7416             JEQ L14
; 6A6: L12:  8B41FD           MOV EAX, [ECX-3]
; 6A9:       85C0             TEST EAX, EAX
; 6AB:       7F0A             JNLE L13
; 6AD:       BB0B001001       MOV EBX, 17825803
; 6B2:       E9C0FEFFFF       JMP L1
; 6B7: L13:  CC0A             BREAK 10                        ; error trap
; 6B9:       02               BYTE #X02
; 6BA:       35               BYTE #X35                       ; NIL-ARRAY-ACCESSED-ERROR
; 6BB:       90               BYTE #X90                       ; ECX
; 6BC: L14:  8BD9             MOV EBX, ECX
; 6BE:       8B71FD           MOV ESI, [ECX-3]
; 6C1:       31C0             XOR EAX, EAX
; 6C3:       EB19             JMP L17
; 6C5: L15:  8BD0             MOV EDX, EAX
; 6C7:       C1FA02           SAR EDX, 2
; 6CA:       0FB6541301       MOVZX EDX, BYTE PTR [EBX+EDX+1]
; 6CF:       83FA2E           CMP EDX, 46
; 6D2:       7507             JNE L16
; 6D4:       8BD8             MOV EBX, EAX
; 6D6:       E99CFEFFFF       JMP L1
; 6DB: L16:  83C004           ADD EAX, 4
; 6DE: L17:  39F0             CMP EAX, ESI
; 6E0:       7CE3             JL L15
; 6E2:       BB0B001001       MOV EBX, 17825803
; 6E7:       E98BFEFFFF       JMP L1



;; with a bit of magic for full optimization
(defun parse-price (price-string decimals)
  (let ((dot (position #\. price-string)))
    (multiple-value-bind (int end) (parse-integer (remove #\. price-string))
      (let ((delta (- end dot decimals)))
        (if (zerop delta) int
            (values (if (> delta 0)
                        (floor int (expt 10 delta))
                        (* int (expt 10 (- delta))))
                    delta))))))

This paste has no annotations.

Colorize as:
Show Line Numbers

Lisppaste pastes can be made by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively.